<%@page import="org.jeecgframework.web.util.StaticValue" %>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title>联系表</title>
    <t:base type="jquery,easyui,tools,DatePicker"></t:base>
    <script type="text/javascript" src="plug-in/ckfinder/ckfinder.js"></script>
</head>
<body>
<t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table"
             action="zyContactsController.do?doUpdate" tiptype="4">
    <table cellpadding="0" cellspacing="1" class="formtable">
        <tr>
            <td align="right">
                <label class="Validform_label">
                    系统用户:
                </label>
            </td>
            <td class="value">
                <input name="realName" class="inputxt" type="text" id="realName"
                       value="${zyContactsPage.tsBaseUser.realName}" readonly="readonly"/>
            </td>
            <td align="right">
                <label class="Validform_label">
                    类型:
                </label>
            </td>
            <td class="value">
                <select name="type" id="type" onchange="changeType()">
                    <option id="cinema_contact" value="cinema_contact">影院联系人</option>
                    <option id="tp_contact" value="tp_contact">第三方联系人</option>
                </select>
            </td>
        </tr>
        <tr>
            <td align="right">
                <label class="Validform_label">
                    所属机构或影院:
                </label>
            </td>
            <td class="value" id="cinema">
                <input name="cinemaName" class="inputxt" type="text" id="cinemaName"
                       value='${zyContactsPage.belongCinema.name}' readonly="readonly" style="width:260px;"/>
            </td>
            <td class="value" id="org" style="display: none;">
                <input name="departname" class="inputxt" type="text" id="departname"
                       value='${zyContactsPage.belongOrg.departname}' readonly="readonly" style="width:260px;"/>
            </td>
            <td align="right">
                <label class="Validform_label">
                    名字:
                </label>
            </td>
            <td class="value">
                <input id="name" name="name" type="text" style="width: 150px" class="inputxt" nullmsg="请填写名字"
                       value="${zyContactsPage.name}"/>
            </td>
        </tr>
        <tr>
            <td align="right">
                <label class="Validform_label">
                    手机1:
                </label>
            </td>
            <td class="value">
                <input id="cellphone1" name="cellphone1" type="text" style="width: 150px" class="inputxt"
                       datatype="cPhone" value="${zyContactsPage.cellphone1}">
            </td>
            <td align="right">
                <label class="Validform_label">
                    手机2:
                </label>
            </td>
            <td class="value">
                <input id="cellphone2" name="cellphone2" type="text" style="width: 150px" class="inputxt"
                       value="${zyContactsPage.cellphone2}">
            </td>
        </tr>
        <tr>
            <td align="right">
                <label class="Validform_label">
                    固话:
                </label>
            </td>
            <td class="value">
                <input id="telephone" name="telephone" type="text" style="width: 150px" class="inputxt"
                       value="${zyContactsPage.telephone}">
            </td>
            <td align="right">
                <label class="Validform_label">
                    性别:
                </label>
            </td>
            <td class="value">
                <t:dictSelect field="gender" type="select" typeGroupCode="<%=StaticValue.DIC_SEX %>"
                              defaultVal="${zyContactsPage.gender}"></t:dictSelect>
            </td>
        </tr>
        <tr>
            <td align="right">
                <label class="Validform_label">
                    传真:
                </label>
            </td>
            <td class="value">
                <input id="fax" name="fax" type="text" style="width: 150px" class="inputxt"
                       value="${zyContactsPage.fax}" datatype="*">
            </td>
            <td align="right">
                <label class="Validform_label">
                    email:
                </label>
            </td>
            <td class="value">
                <input id="email" name="email" type="text" style="width: 150px" class="inputxt"
                       value="${zyContactsPage.email}">
            </td>
        </tr>
        <tr>
            <td align="right">
                <label class="Validform_label">
                    职位:
                </label>
            </td>
            <td class="value">
                <t:dictSelect field="position" type="select" typeGroupCode="<%=StaticValue.DIC_CONTACT_POSITION %>"
                              defaultVal="${zyContactsPage.position}"></t:dictSelect>
            </td>
            <td align="right">
                <label class="Validform_label">
                    来源:
                </label>
            </td>
            <td class="value">
                <input id="source" name="source" type="text" style="width: 150px" class="inputxt"
                       value="${zyContactsPage.source}">
            </td>
        </tr>

        <tr>
            <td align="right">
                <label class="Validform_label">
                    是否认证:
                </label>
            </td>
            <td class="value">
                <t:dictSelect field="authentication" id="authentication" type="select" typeGroupCode="trueOfFlaseNum"
                              defaultVal="${zyContactsPage.authentication}"></t:dictSelect>
            </td>

            <td align="right">
                <label class="Validform_label">
                    状态:
                </label>
            </td>
            <td class="value">
                <t:dictSelect field="state" id="state" type="select"
                              typeGroupCode="<%=StaticValue.DIC_ENGINEER_STATE %>"
                              defaultVal="${zyContactsPage.state}"/>
                <span class="Validform_checktip"></span>
                <label class="Validform_label" style="display: none;">状态</label>
            </td>
        </tr>
        <tr>
            <td align="right">
                <label class="Validform_label">
                    联系业务:
                </label>
            </td>
            <td class="value" colspan="3">
                <t:dictSelect field="conBusiness" type="checkbox" typeGroupCode="<%=StaticValue.DIC_LINK_BUSINESS %>"
                              defaultVal="${zyContactsPage.conBusiness}"/>
                <span class="Validform_checktip"></span>
                <label class="Validform_label" style="display: none;">联系业务</label>
            </td>
        </tr>
    </table>
</t:formvalid>
</body>
<script src="webpage/com/zybk/zy_contacts/zyContacts.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        var type = "${zyContactsPage.type}";
        if (type === "tp_contact") {
            $("#tp_contact").attr("selected", true);
            $("#org").show();
            $("#cinema").hide();
        } else if (type === "cinema_contact") {
            $("#cinema_contact").attr("selected", true);
            $("#cinema").show();
            $("#org").hide();
        }
        $("select option:selected").each(function () {
            var text = $(this).val() == "" ? "否" : $(this).text();
            $(this).parent().after('<input type="text" style="width: 150px" class="inputxt" value="' + text + '" />').remove();
        });
        $("input").attr({"readonly": "readonly", "disabled": "disabled"});
    });
</script>